package com.group5.onlinegame.handler;

import com.group5.onlinegame.entity.Modules;
import com.group5.onlinegame.service.IModulesService;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.annotation.Resource;
import java.util.List;

@Controller
@RequestMapping("/")
public class ModuleManagerHandler {

    @Resource
    private IModulesService modulesService;

    @RequestMapping("lsitModules")
    public String lsitModules(Model model) {
        List<Modules> modulesList = modulesService.getAllModules();
        model.addAttribute("modulesList",modulesList);
        return "module";
    }
}
